<template>
  <div class="">
    <div class="hendbox" v-if="leftshow">
      <!-- 左侧标题 -->
      <div class="leftbox" @click="gohome">
        <img src="@/images/leftbj.png" alt="" class="leftbj" />
        <img src="@/images/lefttext.png" alt="" class="lefttext" />
        <img src="@/images/lefticon.png" alt="" class="leftiocn" />
      </div>
      <!-- 右侧中飞标记 -->
      <div class="headiconbox" v-if="leftshow">山东中飞科技有限公司·研发</div>
      <!-- 右侧标题 -->
      <div class="herightbox">
        <!-- 背景 -->
        <img src="@/images/herightbj.png" alt="" class="herightbj" />
        <!-- 按钮整体框 -->
        <div class="anbox">
          <!-- 按钮 -->
          <div class="ment1 tool" @click="tipshow = true">
            <!-- 背景 -->
            <img src="@/images/anbj.png" alt="" class="anbj" />
            <img src="@/images/men1iocn.png" alt="" class="normal" />
            <img src="@/images/men1iconac.png" alt="" class="active" />
          </div>
          <div class="ment2 tool" @click="audoFn" v-if="audo">
            <!-- 背景 -->
            <img src="@/images/anbj.png" alt="" class="anbj" />
            <img src="@/images/men2icon.png" alt="" class="normal" />
            <img src="@/images/men2iconac.png" alt="" class="active" />
          </div>
          <div class="ment2ac tool" @click="audoFns" v-if="!audo">
            <!-- 背景 -->
            <img src="@/images/anbj.png" alt="" class="anbj" />
            <img src="@/images/jy.png" alt="" class="normal" />
            <img src="@/images/jy.png" alt="" class="active" />
          </div>
          <div class="ment3 tool" @click.stop="closeFn">
            <!-- 背景 -->
            <img src="@/images/anbj.png" alt="" class="anbj" />
            <img src="@/images/men3icon.png" alt="" class="normal" />
            <img src="@/images/men3iconac.png" alt="" class="active" />
          </div>
        </div>
      </div>
    </div>

    <div class="tipsbox" v-if="tipshow">
      <img src="@/images/tips.png" alt="" class="tipsimg" />
      <img
        src="@/images/tipsclose.png"
        alt=""
        class="tipscloseimg"
        @click="tipshow = false"
      />
    </div>
  </div>
</template>

<script>
  //这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
  //例如：import 《组件名称》 from '《组件路径》';

  export default {
    //import引入的组件需要注入到对象中才能使用
    components: {},
    props: {
      leftshow: Boolean,
    },
    data() {
      //这里存放数据
      return {
        tipshow: false,
        audo: true,
      };
    },
    //监听属性 类似于data概念
    computed: {},
    //监控data中的数据变化
    watch: {},
    //方法集合
    methods: {
      gohome() {
        this.$router.push({
          name: 'home',
        });
      },
      //静音按钮
      audoFn() {
        this.audo = !this.audo;
        var element = document.querySelectorAll('video, audio');

        element[0].muted = true;
      },
      //取消静音按钮
      audoFns() {
        this.audo = !this.audo;
        var element = document.querySelectorAll('video, audio');
        element[0].muted = false;
      },
      //关闭按钮
      closeFn() {
        if (
          navigator.userAgent.indexOf('Firefox') != -1 ||
          navigator.userAgent.indexOf('Chrome') != -1
        ) {
          window.location.href = 'about:blank';
          window.close();
        } else {
          window.opener = null;
          window.open('', '_self');
          window.close();
        }
      },
    },
    //生命周期 - 创建完成（可以访问当前this实例）
    created() {},
    //生命周期 - 挂载完成（可以访问DOM元素）
    mounted() {},
    beforeCreate() {}, //生命周期 - 创建之前
    beforeMount() {}, //生命周期 - 挂载之前
    beforeUpdate() {}, //生命周期 - 更新之前
    updated() {}, //生命周期 - 更新之后
    beforeDestroy() {}, //生命周期 - 销毁之前
    destroyed() {}, //生命周期 - 销毁完成
    activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
  };
</script>
<style scoped>
  .hendbox {
    position: absolute;
    top: 0px;
    left: 0px;
    z-index: 99;
    width: 100%;
    height: 80px;
  }

  .herightbox {
    position: absolute;
    right: 0px;
  }
  .herightbj {
    width: 340px;
    height: 80px;
    position: relative;
  }

  .ment1 {
    margin: 0px 15px;
    cursor: pointer;
  }
  .ment2 {
    margin: 0px 15px;
    cursor: pointer;
  }
  .ment3 {
    margin: 0px 15px;
    cursor: pointer;
  }

  .ment1 img {
    position: absolute;
    width: 20px;
    height: 34px;
  }
  .ment2ac {
    margin: 0px 15px;
    cursor: pointer;
  }
  .ment2ac img {
    position: absolute;
    width: 23px;
    height: 22px;
  }
  .ment2 img {
    position: absolute;
    width: 24px;
    height: 34px;
  }
  .ment3 img {
    position: absolute;
    width: 30px;
    height: 30px;
  }
  .anbj {
    width: 60px !important;
    height: 60px !important;
    position: relative !important;
  }
  .anbox {
    display: flex;
    position: absolute;
    top: 2px;
    left: 55px;
  }
  .tipsbox {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
  }
  .tipsimg {
    width: 477px;
    height: 431px;
  }
  .tipscloseimg {
    width: 31px;
    height: 31px;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 20px;
  }
  .headiconbox {
    font-weight: 500;

    font-size: 24px;
    color: #40495a;
    position: absolute;
    right: 354px;
    top: 19px;
  }
  .leftbox {
    position: absolute;
    left: 0px;
    top: 0px;
    cursor: pointer;
  }
  .leftbj {
    width: 676px;
    height: 96px;
  }
  .lefttext {
    width: 463px;
    height: 33px;
    position: absolute;
    left: 130px;
    top: 15px;
  }
  .leftiocn {
    width: 52px;
    height: 80px;
    position: absolute;
    left: 20px;
    top: 5px;
  }
</style>
